﻿'    This file is part of The Global Distribution System.

'    The Global Distribution System is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 3 of the License, or
'    (at your option) any later version.

'    The Global Distribution System is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.

'    You should have received a copy of the GNU General Public License
'    along with The Global Distribution System.  If not, see <http://www.gnu.org/licenses/>.

Public Class Form_Options
    Public Property CTS As GDS
    Private Loading As Boolean = True
    Public Sub New(ByRef CTS As GDS)

        InitializeComponent()
        Me.CTS = CTS

    End Sub

    Private Sub btn_textfiles_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_textfiles.MouseEnter
        rtb_descriptions.Text = "Quickly generate 'Server Verified' Text Files for the \PokemonFiles\ directory." & Environment.NewLine & "This will also delete all current Text Files inside the \TextFiles\ directory as well."
    End Sub

    Private Sub Form_Options_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
        rtb_descriptions.Text = "Mouseover a Button to see more information on it."
    End Sub

    Private Sub btn_textfiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_textfiles.Click
        CTS.CreateTextFiles()
    End Sub

    Private Sub btn_refresh_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_refresh.MouseEnter
        rtb_descriptions.Text = "Forces a refresh on the Search Engine."
    End Sub

    Private Sub btn_refresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_refresh.Click
        CTS.RefreshSearcher()
    End Sub

    Private Sub Button1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_print.MouseEnter
        rtb_descriptions.Text = "Print to the log the size of the Search Engine."
    End Sub

    Private Sub btn_print_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_print.Click
        CTS.GetSearchSize()
    End Sub

    Private Sub cb_uploads_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb_uploads.CheckedChanged
        If Not Loading Then CTS.EnableUploads = cb_uploads.Checked
    End Sub

    Private Sub Form_Options_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        cb_uploads.Checked = CTS.EnableUploads
        Loading = False
    End Sub

    Private Sub cb_uploads_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles cb_uploads.MouseEnter
        rtb_descriptions.Text = "Allows or disallows uploads from the Global Distribution Clients. This does -NOT- affect the Global Trade Server which only accepts uploads when Receive Mode is enabled."
    End Sub

End Class